package com.larissa.quiz.database;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;


import com.larissa.quiz.Question;

import java.util.List;
import java.util.UUID;


@Dao
public interface QuestionDao {
    @Query("SELECT * FROM Question")
    LiveData<List<Question>> getQuestions();

    @Query("SELECT * FROM Question WHERE id=:id")
    LiveData<Question>getQuestionById(UUID id);

    @Insert
    void addQuestion(Question question);

    @Update
    void updateQuestion(Question question);
}